#include<bits/stdc++.h>
#include<cstdio>
#include<map>
#include<queue>
#include<vector>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<stack>
using namespace std;
const int maxn=1e5+8;
struct node{
    int x,y;
}a[maxn];
bool cmp(node a,node b){
    return a.x<b.x;
}
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i].x;
        a[i].y=a[i].x;
    }
    stable_sort(a,a+n,cmp);
    int cnt=n;
    for(int i=0;i<n;i++)
    {
        int s=i+1;
        while(1)
        {
            if(a[s].x>a[i].y||s==n)
                break;
            s++;
        }
        if(s!=n){
            a[s].x=-1;
            a[i].y=-1;
            cnt--;
        }
        else if(a[n-1].x>a[i].y){
            a[s].x=-1;
            a[i].y=-1;
            cnt--;
        }
        else{
            cout<<cnt;
            return 0;
        }

    }
    cout<<cnt;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
